//
//  SubjectBgImageTableViewCell.m
//  AroundTheWorld
//
//  Created by dllo on 16/5/17.
//  Copyright © 2016年 IfelseGo an. All rights reserved.
//

#import "SubjectBgImageTableViewCell.h"
#import "SubjectModel.h"

@implementation SubjectBgImageTableViewCell
//自定义初始化
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addView];
    }
    return self;
}

- (void)addView
{
    self.myBgImageView = [self addUIImageView];
}

- (UIImageView *)addUIImageView
{
    UIImageView *imageV = [[UIImageView alloc] init];
    self.contentView.dk_backgroundColorPicker = DKColorPickerWithRGB(0xffffff,0xCFCFCF);
//    imageV.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:imageV];
    return imageV;
}

//分布
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.myBgImageView.frame = CGRectMake(7, 0, 400, 165);
}

- (void)setSubjectArray:(NSArray *)subjectArray
{
    _subjectArray = subjectArray;
    SubjectModel *bgModel = [_subjectArray objectAtIndex:0];
    [self.myBgImageView sd_setImageWithURL:[NSURL URLWithString:bgModel.photo] placeholderImage:nil];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
